#include <Windows.h>
#include "CGame.h"
#include "CTimer.h"

int WINAPI WinMain(HINSTANCE hInst,HINSTANCE hPrevInst,LPSTR lpCmdLine,int nShowCMD)
{
	CGame* game = new CGame();
	CTimer* timer = CTimer::GetInstance();
	game->Game_Init(hInst);
	MSG msg;
	ZeroMemory(&msg,sizeof(MSG));
	int done = 0;
	while(!done)
	{
		if(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
		{
			if(msg.message == WM_QUIT)
			{
				done = 1;
			}
			TranslateMessage(&msg);
			DispatchMessage(&msg);

		}
		game->Game_Run();
	}
	game->Game_End();
	return msg.wParam;	
}